package com.jugheadzhou.streamproducer.controller;

import com.jugheadzhou.streamproducer.service.CustomService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author jugheadzhou
 * @date 2021-09-28
 */
@RestController
@RequestMapping("stream/")
public class ProducerController {

//    @Resource
//    private DefaultService defaultService;

    @Resource
    private CustomService customService;

    /**
     * 通过自定义通道发送
     *
     * @param msg
     * @return
     */
    @GetMapping("custom/send/{msg}")
    public String customSend(@PathVariable("msg") String msg){
        customService.sendMsg(msg);
        return "通过自定义通道发送成功";
    }

//    @GetMapping("send/{msg}")
//    public String send(@PathVariable("msg") String msg){
//        defaultService.sendMsg(msg);
//        return "通过默认通道发送成功";
//    }



}
